package co.fitstart.admin.service;

import java.util.Date;
import java.util.List;

import com.demo2do.core.support.Page;

import co.fitstart.admin.entity.search.SourceSearch;
import co.fitstart.entity.site.Site;
import co.fitstart.entity.user.UserSource;
import co.fitstart.entity.user.UserSourceRecord;
import co.fitstart.entity.user.UserSourceStatus;
import co.fitstart.entity.user.UserSourceType;

public interface UserSourceService extends DataService<UserSource> {
	
	/**
	 * 
	 * @param name
	 * @return
	 */
	public UserSourceType loadSourceType(String name);
	
	/**
	 * 
	 * @param site
	 * @return
	 */
	public List<UserSource> listSource(Site site, UserSourceStatus userSourceStatus);
	
	/**
	 * 
	 * @param beginDate
	 * @param endDate
	 * @return
	 */
	public List<UserSource> listSource(Date beginDate, Date endDate, Site site);
	
	/**
	 * 
	 * @param beginDate
	 * @param endDate
	 * @param sites
	 * @return
	 */
	public List<UserSource> listSource(Date beginDate, Date endDate, List<Site> sites);
	
	/**
	 * 
	 * @param page
	 * @return
	 */
	public List<UserSource> listSource(Site site, Page page, UserSourceStatus userSourceStatus);
	
	/**
	 * 
	 * @param sites
	 * @param page
	 * @return
	 */
	public List<UserSource> listSource(List<Site> sites, Page page, UserSourceStatus userSourceStatus);
	
	/**
	 * 
	 * @param userSource
	 * @param page
	 * @return
	 */
    public List<UserSource> search(SourceSearch sourceSearch, Page page);
    
    /**
     * 
     * @param mobile
     * @return
     */
    public UserSource load(String mobile);
    
    /**
     * 
     * @param site
     * @param name
     * @param mobile
     * @param gender
     * @param wechatNumber
     * @param requirement
     * @param receiver
     * @param phoneReciver
     * @param userSourceType
     * @param newSourceChannel
     */
    public void create(Date occurDate, Site site, String name, String mobile, String gender, String wechatNumber, String requirement, Long receiver, Long phoneReciver, Long userSourceType, String newSourceChannel);
    
    /**
     * 
     * @param site
     * @param userSource
     * @param type
     * @param description
     * @param remark
     * @param receiver
     * @return
     */
    public UserSourceRecord createRecord(Site site, UserSource userSource, String type, String description, String remark, Long receiver);
    
    /**
     * 
     * @param userSource
     * @return
     */
    public List<UserSourceRecord> listRecords(UserSource userSource);
    
    /**
     * 
     * @param userSources
     */
    public void batchCreate(List<UserSource> userSources, Site site);
    
    /**
     * 
     */
    public void refreshAllType();

}
